//
//  AppDelegate.m
//  ShareDemo
//
//  Created by zhangyongbin on 7/14/15.
//  Copyright (c) 2015 Beijing YunJi Technology Company. All rights reserved.
//

#import "AppDelegate.h"
#import "JBSNSShare.h"

@interface AppDelegate ()

@end

@implementation AppDelegate


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
    // Override point for customization after application launch.
    
    //   设置在友盟平台上的AppKey
    [JBSNSShare setSNSSharePlatformAppKey:@"53290df956240b6b4a0084b3"];
    
    //  设置公司官网地址
    [JBSNSShare setAppWebSitURL:@"http://www.baidu.com"];
    
    //打开新浪微博的SSO开关，设置新浪微博回调地址，这里必须要和在新浪微博后台设置的回调地址一致。若在新浪后台设置的回调地址为友盟提供的地址：“http://sns.whalecloud.com/sina2/callback”，这里可以传nil
    [JBSNSShare openSinaWeiboSSOWithRedirectURL:nil];
    
    //  设置微信AppId、appSecret
    [JBSNSShare setSNSAuthInfoWithSnsType:JBSNSTypeWechat appId:@"wxd930ea5d5a258f4f" appKey:nil appSecret:@"db426a9829e4b49a0dcac7b4162da6b6"];
    
    //  设置QQ和QZone的AppId、appKey
    [JBSNSShare setSNSAuthInfoWithSnsType:JBSNSTypeQQ appId:@"100424468" appKey:@"c7394704798a158208a74ab60104f0ba" appSecret:nil];
    
    return YES;
}

- (BOOL)application:(UIApplication *)application openURL:(NSURL *)url sourceApplication:(NSString *)sourceApplication annotation:(id)annotation
{
    return  [JBSNSShare handleOpenURL:url];
}

- (void)applicationDidBecomeActive:(UIApplication *)application {
    // Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface.
    [JBSNSShare applicationDidBecomeActive];
}

@end
